<%@page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib uri="TowkerTagLib" prefix="rbac"%>
<%@ taglib uri="/WEB-INF/tags/CommonFunction.tld" prefix="cfn" %>  
<%@include file="/commons/include/html_doctype.html" %>
<html>
<head>
	<title>账面明细</title>
	<%@include file="/commons/include/get.jsp" %>
	<script type="text/javascript">
		//放置脚本
	</script>
</head> 
<body>
<table border="0" cellspacing="0" cellpadding="0" class="listLogo">
	<tr>
		<td class="title"><c:if test="${param.isAccount==1}">账面明细</c:if><c:if test="${param.isAccount==0 }">进出仓明细</c:if><span class="title" style="margin-left:20px;">物料代码:${goods.goods_sn } 名称:${goods.goods_name } 计量单位:${goods.unit } 单位重量:${goods.weight } 存储仓库:${depot.depot_nane }(${ depot.depot_code})</span></td>
		<td>
			<div class="menuTool">
				<a class="back" onClick="javascript:window.history.back();return false;" href="#">返回</a>
			</div>
		</td>
	</tr>
</table>
<div class="line"></div>
<form id="listForm" method="post" action="delWarehouseAccounts.htm">
<table border="0" cellspacing="1" cellpadding="0" class="listTable">
	<tr class="list_title">
		<td>核算期</td>
		<td>日期</td>
		<td>入仓数量</td>
		<td>出仓数量</td>
		<td>账面结存数量</td>
		<td>记账单据</td>
		<td>单号</td>
		<td>客户代码</td>
		<td>客户名称</td>
        <td>部门名称</td>
	</tr>
	<c:set var="sumAmount" value="${preAmount }" />
<c:forEach items="${pageModel.result}" var="d" varStatus="status">
	<c:set var="sumAmount" value="${d.amount+sumAmount }" />
	<tr class="${status.index%2==0?'list_even':'list_odd'}">
		<td>${fn:escapeXml(d.accPeriod)}</td>
		<td>${cfn:formatDate(d.optDate, 'yyyy-MM-dd')}</td>
		<td><c:if test="${d.amount gt 0 }">${d.amount }</c:if></td>
		<td><c:if test="${d.amount lt 0 }">${d.amount }</c:if></td>
		<td>${fn:escapeXml(sumAmount)}</td>
		<td>
		<c:choose>
		<c:when test="${d.billType == 5 }">出仓单</c:when>
		<c:when test="${d.billType == 2 }">发货单</c:when>
		<c:when test="${d.billType == 4 }">入仓单</c:when>
		<c:when test="${d.billType == 7 }">原材料调拨</c:when>
		</c:choose>
		</td>
		<td>
		<c:choose>
		<c:when test="${d.billType == 5 }"><a href="${ctx }/manage/warehouse/getOutWarehouseById.htm?keyIndex=${d.billId}">${fn:escapeXml(d.billCode)}</a></c:when>
		<c:when test="${d.billType == 2 }"><a href="${ctx }/manage/warehouse/getSendBillsById.htm?keyIndex=${d.billId}">${fn:escapeXml(d.billCode)}</a></c:when>
		<c:when test="${d.billType == 4 }"><a href="${ctx }/manage/warehouse/getInWarehouseById.htm?keyIndex=${d.billId}">${fn:escapeXml(d.billCode)}</a></c:when>
		<c:when test="${d.billType == 7 }"><a href="${ctx }/manage/warehouse/getMaterialAllocatesById.htm?keyIndex=${d.billId}">${fn:escapeXml(d.billCode)}</a></c:when>
		</c:choose>
		</td>
		<td>${fn:escapeXml(d.customCode)}</td>
		<td>${fn:escapeXml(d.customName)}</td>
        <td>${fn:escapeXml(d.depName)}</td>
	</tr>
</c:forEach>
</table>
<input id="_submit_" type="submit" style="display:none;" />
</form>
<table border="0" cellspacing="0" cellpadding="0" class="bottomTable">
	<tr><td>${pageNav.page}</td></tr>
</table>
</body>
</html>
